home *** CD-ROM | disk | FTP | other *** search
/ Risc World 3 / Risc World 3.iso / !RWORLD / UTILITIES / !XFILES / !HELP < prev    next >
Text File  |  1997-02-22  |  6KB  |  132 lines

  1. X-Files: A RISC OS image filing system
  2. ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  3. Last Wednesday I finally cracked. In my long relationship with Acorn
  4. machines I'd seen "Directory full" one too many times. Here's the result.
  5.  
  6. X-Files is an image filing system. An image filing system is an FS which can
  7. open a file and treat it's contents as a nested filesystem within the
  8. filesystem containing the file.
  9.  
  10. X-Files supports long filenames (up to 256 characters internally, although
  11. you'd be hard pressed to create a file with a 256 character name under RISC
  12. OS) and an unlimited number of files per directory. Other than that it does
  13. the things you'd expect an image filing system to do.
  14.  
  15. PROS AND CONS
  16. ¨¨¨¨¨¨¨¨¨¨¨¨¨
  17. If you want to have long filenames and directories which contain lots of
  18. files you can either a) write a set of patches which emulate this in an
  19. existing filesystem using hidden files and the like or b) write an image
  20. filing system.
  21.  
  22. Solution "a" is transparent to the user and can benefit from the underlying
  23. filing system's proven ability to keep track of directories and files
  24. without getting in a muddle.
  25.  
  26. Solution "b" requires a whole new filing system to be written, isn't
  27. transparent to the user and is more likely to lose all your data if the
  28. person who wrote it screwed up.
  29.  
  30. Obviously I've chosen solution "b".
  31.  
  32. Purists may be offended by the fact the X-Files is written in C. Tough. I
  33. needed it quick and although ARM assembler is a dream to write I don't
  34. reckon I could have had it working in two and a bit days if I'd written it
  35. in assembler.
  36.  
  37. IMPLEMENTATION
  38. ¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  39. X-Files consists of a storage allocator which keeps track of which bits of
  40. an image contain what, a directory handler which keeps track of the file
  41. hierarchy and a cache manager which keeps recently access bits of the image
  42. in memory in case they're needed again (they frequently are).
  43.  
  44. The storage allocator is pretty simple minded. If an object (file or
  45. directory) can grow in place it will otherwise it moves to the end of the
  46. image so that extending it is simply a matter of extending the image file.
  47. This leaves big holes are squashed out when the wasted space exceeds 1/3 of
  48. the image's total size. In the normal course of events compression will not
  49. occur more frequently than once every thirty seconds.
  50.  
  51. PERFORMANCE
  52. ¨¨¨¨¨¨¨¨¨¨¨
  53. Most things are a bit slower than the underlying filesystem, although raw
  54. data transfer rates are not measurably affected and a few operations are
  55. actually quicker. At the moment the cache manager writes through in an
  56. attempt to try to avoid losing your data. It has been designed to be equally
  57. viable in delayed write mode which will I expect make X-Files quicker
  58. overall than the underlying filesystem.
  59.  
  60. *** STOP PRESS ***
  61.  
  62. 0.54 includes write behind caching which does speed things up a lot.
  63.  
  64. IN USE
  65. ¨¨¨¨¨¨
  66. When X-Files gets out of beta (and I have time) I'll write some spiffy
  67. extensions to the filer or something. For now though the only thing you
  68. really need is:
  69.  
  70. How to create a new X-Files image
  71.  
  72. Create an empty file (length 0) and set it's type to X-File like this
  73.  
  74.    *Create SpogMunge
  75.    *SetType SpogMunge X-File
  76.  
  77. Now you can open it and start sticking files in it. Easy no?
  78.  
  79. Actually, you can only set the file's type to X-File is you've arranged for 
  80.  
  81.    *Set File$Type_B23 X-File
  82.  
  83. to have been executed as well. You could of course just set the file's type
  84. to &B23.
  85.  
  86. This is very much development code. In particular it has a load of asserts
  87. and other debug code in it which will, when things get sticky, attempt to
  88. produce debug output. To see this output you'll need to run !Tracker
  89. (included) when you're running X-Files. When reporting bugs I'd be grateful
  90. if you could send any associated output (you can save the contents of the
  91. Tracker window -- incidently don't let the poor quality of Tracker prejudice
  92. you against X-Files -- it's the first desktop program I wrote when RISC OS 2
  93. appeared and I haven't updated it in years).
  94.  
  95. DISCLAIMER
  96. ¨¨¨¨¨¨¨¨¨¨
  97. At the time of writing X-Files is three days old. I use it to store really
  98. important files pertaining to the project I'm working on. I trust you're not
  99. that reckless, but if you are and it all turns nasty, don't come crying to
  100. me.
  101.  
  102. HISTORY
  103. ¨¨¨¨¨¨¨
  104.  0.50  25.03.96  First release to beta testers
  105.  
  106.  0.51  26.03.96  Second release to beta testers. Found and fixed a bug
  107.                  whereby compaction could cause broken directories and
  108.                  other 'things moving when other things didn't expect
  109.                  it' sort of bugs.
  110.                  
  111.  0.52  27.03.96  Fixed problems with cache index table getting munged.
  112.                  When entries became invalid (image closed or shrunk),
  113.                  I was setting their owner and offset fields to zero
  114.                  which made them compare incorrectly with their
  115.                  neighbours. The knock-on effect of this was potentially
  116.                  catastrophic!
  117.  
  118.  0.53  30.03.96  Various bug fixes. Nothing data threatening -- just
  119.                  silliness really. The worst one was due to me not
  120.                  having fully considered the implications of zero
  121.                  length chunks floating around the filesystem.
  122.  
  123.  0.54   1.04.96  Write behind caching enabled. The cache is flushed two
  124.                  seconds after the last access.
  125.  
  126.  0.55   2.04.96  Humble pie time. Didn't run all the tests did I?
  127.                  I think it's fixed now...
  128.  
  129.  0.57  22.02.97  Recompiled with write behind turned off again which seems
  130.                  to improve reliability somewhat :-) Release now includes
  131.                  Nicholas Clark's X-Recover utility.
  132.